home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 025 (1987-08-15)(Ossowski, Stefan)(DE)(PD).zip
/
Taifun 025 (1987-08-15)(Ossowski, Stefan)(DE)(PD).adf
/
Demos
/
Linien.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-03-08
|
2KB
|
95 lines
#define TIEFE 1
#define RAND 64
#define BREITE 512
#define HOEHE 512
#define FARBEN 2
#include <exec/types.h>
#include <intuition/intuition.h>
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
#define INTUITION_REV 33 /* Versionsnummer! */
#define GRAPHICS_REV 33
/* Deklaration eines vordefinierten NewScreen Datenblocks */
struct NewScreen NewScreen =
{
0, /* linke Ecke sollte 0 sein */
0, /* obere Ecke */
640, /* Breite (hi-res) */
HOEHE, /* Hoehe (Interlace) */
TIEFE, /* Tiefe (1 bit plane) */
0, 1, /* DetailPen und BlockPen */
HIRES|LACE, /* Anzeige-Modi */
CUSTOMSCREEN, /* Schirm-Typ */
NULL, /* Font */
NULL, /* Schirm-Titel */
NULL, /* keine speziellen screen gadgets */
NULL, /* keine custom bit map */
};
main()
{
struct Screen *Screen;
struct NewWindow NewWindow;
struct Window *Window;
REGISTER struct RastPort *rp;
struct IntuiMessage *Message;
LONG i;
REGISTER SHORT x,y,s;
UBYTE z=0;
/* Oeffnen der Library und Ueberpruefung */
IntuitionBase = (struct IntuitionBase *)
OpenLibrary("intuition.library",INTUITION_REV);
if (IntuitionBase == NULL) exit(FALSE);
GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", GRAPHICS_REV);
if (GfxBase == NULL) exit(FALSE);
if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL) exit(FALSE);
/* Initialisieren der NewWindow structure fuer den OpenWindow()-Aufruf */
NewWindow.LeftEdge = RAND;
NewWindow.TopEdge = 0;
NewWindow.Width = BREITE;
NewWindow.Height = HOEHE;
NewWindow.DetailPen = 0;
NewWindow.BlockPen = 1;
NewWindow.Title = NULL;
NewWindow.Flags = ACTIVATE|BORDERLESS;
NewWindow.IDCMPFlags = MOUSEBUTTONS;
NewWindow.Type = CUSTOMSCREEN;
NewWindow.FirstGadget = NULL;
NewWindow.CheckMark = NULL;
NewWindow.Screen = Screen;
NewWindow.BitMap = NULL;
if (( Window = (struct Window *)OpenWindow(&NewWindow)) == NULL) exit(FALSE);
rp=Window->RPort; /* RastPort-Adresse */
SetDrMd(rp,COMPLEMENT); /* Zeichenmodus */
do {
for(s=1; s<HOEHE; s++) {
for(x=0,y=0; x<=BREITE; x+=s) {
Move(rp,x,y);
Draw(rp,BREITE-x,HOEHE);
}
for(x=0,y=HOEHE; y>=0; y-=s) {
Move(rp,x,y);
Draw(rp,BREITE,HOEHE-y);
}
Message=(struct IntuiMessage *)GetMsg(Window->UserPort);
if(Message->Class == MOUSEBUTTONS) break;
}
} while ((Message->Class) != MOUSEBUTTONS);
CloseWindow(Window);
CloseScreen(Screen);
exit(TRUE);
}